package com.chenjt.langchain4j.assistant;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

/**
 * 注释：
 *
 * @author chenjt
 * @date 2025/4/25 11:37
 */
@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,// 表示需要明确声明大语言模型
//        chatModel = "qwenChatModel",
        streamingChatModel = "qwenStreamingChatModel", // 流式输出大模型
        chatMemoryProvider = "chatMemoryProviderXiaozhi", // 配置聊天记忆
        tools = "appointmentTools",
        contentRetriever = "contentRetrieverXiaozhi"
//        contentRetriever = "contentRetrieverXiaozhiPincone"
)
public interface XiaozhiAgent {


//    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
//    String chat(@MemoryId Long memoryId,@UserMessage String userMessage);


    /**
     * 流式输出的返回值是Flux
     * @param memoryId
     * @param userMessage
     * @return
     */
    @SystemMessage(fromResource = "xiaozhi-prompt-template.txt")
    Flux<String> chat(@MemoryId Long memoryId, @UserMessage String userMessage);

}
